<?php
// No directAcces
defined('_AppBackMiage') or die('Restricted access');
if(isAdministrateur ()){
    include_once (DS . "backoffice/include/header.php");
    include_once( DS . "backoffice/include/toppanel_utilisateurs.php");
    ?>
    <div id="wrapper">
        <div id="content">
            <div id="rightnow">
                <h3 class="reallynow">
                    <span>Listes des UFR</span>
                    <a href="<?php echo URL; ?>index.php?m=admin_userufr_add" class="add">Ajouter une UFR</a>
                    <br />
                </h3>
                <p class="youhave">
                <?php
                $lstUFR = UFR::getList();

                $count = UFR::globalCount();

                if (!empty($lstUFR))
                {
                ?>
                    <table width="100%">
                        <thead>
                            <tr>
                                <th>Nom</th>
                                <th width="60px">Action</th>
                            </tr>
                        </thead>
                        <tbody>
                        <?php
                        foreach ($lstUFR as $i=>$u)
                        {
                            $editURL = URL . "/index.php?m=admin_userufr_edit&uid=" . $i;
                            ?>
                            <tr>
                                <td><?php echo $u; ?></td>
                                <td>
                                    <a href="<?php echo $editURL; ?>">
                                        <img src="<?php echo STYLEBK; ?>img/icons/user_edit.png" title="Edit user" width="16" height="16" />
                                    </a>
                                </td>
                            </tr>
                        <?php
                        }
                        ?>
                        </tbody>
                    </table>
                    <div id="pager">
                        Total <strong><?php echo $count; ?></strong> UFR trouv&eacute;s
                    </div>
                <?php
                }
                else
                {
                    echo 'rien';
                }
                ?>
                </p>
            </div>
        </div>
    <?php
        include_once (DS . "backoffice/include/sidebar.php");
        include_once (DS . "backoffice/include/footer.php");
}
else
{
    redirectTo(URLBACK);
}
?>